package com.daervin.common.dto;

import com.daervin.common.code.CodeEnum;

/**
 * Created by daervin on 2021/4/1
 */
public class Result<T> {
    private Integer code;
    private String msg;
    private T data;


    public Result(CodeEnum code) {
        this.code = code.code;
        this.msg = code.msg;
    }

    public Result(T data) {
        this.code = CodeEnum.SUCCESS.code;
        this.msg = CodeEnum.SUCCESS.msg;
        this.data = data;
    }

    public Result(CodeEnum code, T data) {
        this.code = code.code;
        this.msg = code.msg;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
